﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace YYSite.Common
{
    /// <summary>
    /// EasyUI datagrid 结果
    /// </summary>
    /// <typeparam name="T"></typeparam>
    [Serializable]
    public class DataGridOutput<T>
    {

        /// <summary>
        /// 当前页
        /// </summary>
        public int PageIndex { get; set; }
        /// <summary>
        /// 分页大小
        /// </summary>
        public int PageSize { get; set; }

        /// <summary>
        /// 总记录数
        /// </summary>
        public int Total { get; set; }
        /// <summary>
        /// 数据集合
        /// </summary>
        public IEnumerable<T> Rows { get; set; }
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="total"></param>
        /// <param name="rows"></param>
        public DataGridOutput(int total, IEnumerable<T> rows)
        {
            this.Total = total;
            this.Rows = rows;

        }

        public DataGridOutput(IEnumerable<T> data, int total, int pageIndex, int pageSize)
        {
            this.Rows = data;
            this.Total = total;
            this.PageIndex = pageIndex;
            this.PageSize = pageSize;
        }
    }
}
